package Day1Zuoye;

import java.util.Objects;

public class Yuangong {
    private String name;
    private int age;
    private String sex;
    private String post;
    private int salary;
    private String number;

    public Yuangong(String name, int age, String sex, String post, int salary, String number) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.post = post;
        this.salary = salary;
        this.number = number;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Yuangong yuangong = (Yuangong) o;
        return age == yuangong.age &&
                salary == yuangong.salary &&
                Objects.equals(name, yuangong.name) &&
                Objects.equals(sex, yuangong.sex) &&
                Objects.equals(post, yuangong.post) &&
                Objects.equals(number, yuangong.number);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, sex, post, salary, number);
    }
}
